home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-10 | 1.6 KB | 60 lines | [TEXT/MPS ] |
- Program BWDemo
- REAL xdata(200), ydata(200), y2data(200)
- INTEGER i,n
- Common /theData/ xdata, ydata, y2data, n
- External CreatePlot
-
- ! Initialize TSI Graphics
- Call InitGraphicsPackage()
-
- ! Create the data for plotting and pass through common blocks
- n = 200
- do i = 1, n
- xdata(i) = i
- ydata(i) = sin(PI*i/(225-i))
- y2data(i) = sin(PI*i/52) * i * 1.1/real(n)
- end do
-
- ! Create a graphics window and hook up our subroutine
- Call DrawInNewWindow(CreatePlot)
-
- ! Make the FORTRAN text window small
- Call MoveOutWindow(10,60,250,120)
- write(*,*) 'TSiGraphics Demo'
-
- ! Exit and let the FORTRAN menus take over
- End
-
-
- Subroutine CreatePlot
- ! Load predefined constants for easier reading of the code
- include 'TSIConstants.fi'
- REAL xdata(200), ydata(200), y2data(200)
- INTEGER n
- Common /theData/ xdata, ydata, y2data, n
-
- ! Initialize the graph window
- Call InitGraphWindow
-
- ! Border the current plot region in Black
- Call BorderPlotRegion(Black)
-
- ! Change font to Times bold, 12
- Call SetTextStyle('Times', bold, 0, 12)
-
- ! Determine the axes automatically, plot the data
- Call AutoAxes(xdata, ydata, n, 0, labelAxis, labelAxis, 0)
- Call LinePlot(xdata, ydata, n, Black)
- Call LinePlot(xdata, y2data, n, Black)
-
- ! Change font to Times bold+italic, 18pt and title the plot region
- Call SetTextStyle('Times', bold+italic, 0, 18)
- Call TitlePlotRegion('Plots of F(Sin(x))')
-
- ! Title the plot window
- Call TitleWindow('Line Plot Demo')
-
- Return
- End
-
-